package com.kd.juhaowan.ui;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.Nullable;


import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallbackProxy;
import com.hjq.toast.ToastUtils;
import com.kd.juhaowan.R;
import com.kd.juhaowan.http.api.FeedbackApi;
import com.kd.juhaowan.http.model.GameModel;
import com.kd.juhaowan.http.model.HttpData;

import butterknife.BindView;
import butterknife.OnClick;

public class FeedBackActivity extends BaseActivity {





    @BindView(R.id.activity_title)
    TextView titleView;
    @BindView(R.id.feedback_content)
    EditText feedbackEdit;


    @Override
    protected void reInitDate() {

    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        titleView.setText("投诉反馈");
//        setContentView(R.layout.activity_account_login);

    }
    @OnClick(R.id.login_confirm)
    public void onConfirmClick(){
        String text = feedbackEdit.getText().toString().trim();
        if(TextUtils.isEmpty(text)){
            ToastUtils.show("请输入内容");
            return;
        }
        EasyHttp.post(this).api(new FeedbackApi(text)).request(new HttpCallbackProxy<HttpData<GameModel>>(this){
            @Override
            public void onHttpSuccess(HttpData<GameModel> result, boolean cache) {
                super.onHttpSuccess(result, cache);
                ToastUtils.show("反馈成功");
                finish();
            }
        });
    }
    @OnClick(R.id.actvity_back)
    public void onBackClick(){
        finish();
    }
    @OnClick(R.id.feedback_kefu)
    public void onKefuClick(){
       startActivity(new Intent(this,KefuActivity.class));
    }
    @Override
    protected int getViewLayoutResourceId() {
        return R.layout.activity_feedback;
    }




}
